home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / amos / AMOSList0993.lzh / AMOSLIST / 000008_amos-request@svcs1.digex.net_Fri Sep 3 21:10:09 1993.msg < prev    next >
Internet Message Format  |  1993-10-03  |  5KB

  1. Received: from nextsun.INS.CWRU.Edu by access.digex.net with SMTP id AA14150
  2.   (5.65c/IDA-1.4.4 for <mcox@access.digex.com>); Fri, 3 Sep 1993 21:10:08 -0400
  3. Received: from svcs1.digex.net by nextsun.INS.CWRU.Edu with SMTP (5.65b+ida+/CWRU-1.5.2-freenet-gw)
  4.     id AA14871; Fri, 3 Sep 93 21:08:35 -0400 (from amos-request@svcs1.digex.net for mcox@access.digex.com)
  5. Received: by svcs1.digex.net id AA03505
  6.   (5.65c/IDA-1.4.4 for amos-list-out); Fri, 3 Sep 1993 20:53:15 -0400
  7. Received: from access.digex.net by svcs1.digex.net with SMTP id AA03500
  8.   (5.65c/IDA-1.4.4 for <amos-list@svcs1.digex.net>); Fri, 3 Sep 1993 20:53:10 -0400
  9. Received: from wraith.cs.uow.edu.au by access.digex.net with SMTP id AA11571
  10.   (5.65c/IDA-1.4.4 for <amos-list@access.digex.net>); Fri, 3 Sep 1993 20:52:31 -0400
  11. Received: by wraith.cs.uow.edu.au
  12.     (5.65c/IDA-1.4.4); id AA10275; Sat, 4 Sep 1993 10:51:51 +1000
  13.     (from u9147063@cs.uow.edu.au for amos-list@access.digex.net)
  14. From: Richard Barry Ling <u9147063@cs.uow.edu.au>
  15. Message-Id: <199309040051.AA10275@wraith.cs.uow.edu.au>
  16. Subject: Re: Look at this 24 lines of code
  17. To: amos-list@access.digex.net (AMOS User group)
  18. Date: Sat, 4 Sep 1993 10:51:50 +1000 (EST)
  19. Mime-Version: 1.0
  20. Content-Type: text/plain; charset=US-ASCII
  21. Content-Transfer-Encoding: 7bit
  22. Content-Length: 3464      
  23. Status: RO
  24.  
  25.  
  26. > HI everyone!!!
  27. > I recently posted some help on a flickering bob routine
  28. > and got about 5 different answers, three of them worked,
  29. > but two of them were FAST, and so I decided to use the
  30. > shortest one of the two.
  31. > Now my problem is, when I tried the piece of code
  32. > in a small individual program, everything worked fine,
  33. > BUT when I tried it in my real-life 24k program, for
  34. > some reason I get NOTHING on the screen!!!
  35. > So here's the 24k code reduced to about 24 lines,
  36. > I'll just show you the commands that have anything
  37. > to do whith handling graphics, ok? here it is:
  38. > screen open 1,352,240,32,lowres
  39. > load iff "infest:gameboard",1
  40. > screen display 1,,20,,
  41. > screen to front 1
  42. > load iff "infest:players",2
  43. > screen to back 2
  44. > change mouse 2
  45. > double buffer
  46. > autoback 0
  47. > update off
  48. >     .
  49. >     .
  50. >     .
  51. > load "infest:infestbobs.abk",1
  52. > screen 1
  53. > load "infest:samples.abk",1
  54. > sam bank 1
  55. >     .
  56. >     .
  57. >     .
  58. > Piece-Anim : rem calls the procedure you guys helped me with
  59. >     .
  60. >     .
  61. >     .
  62. > procedure Piece-Anim
  63. > for range=rangeL to rangeR
  64. >    bob clear
  65. >    bob 1,xblit,yblit,range
  66. >    bob draw
  67. >    screen swap
  68. >    wait 2
  69. > next range
  70. > end proc
  71. > rem this is it!, so what am I doing wrong here?????????????
  72.  
  73. Well, as Andy pointed out, you can't load two data files into bank 1, since
  74. the previous bank gets forgotten.
  75.  
  76. The other thing is that you're opening screen 2, which selects screen 2 as
  77. the current screen; then you call double buffer, which double buffers screen
  78. 2 (always double buffers the current screen!) and then you're selecting
  79. screen 1 again and doing the animation, and screen 1 isn't double buffered!
  80. So even if you could display the animation, it would still flicker.
  81.  
  82. For the above program, I suggest calling Double Buffer right after opening
  83. the screen 1.
  84.  
  85. A couple of other pointers:
  86.  
  87.  * opening a screen brings it to the front, so no need for
  88.    screen to front 1.  It also "selects" that screen.
  89.  
  90.  * using Load Iff with a screen number automagically opens a screen
  91.    appropriate for the picture, closing any screen with the same screen
  92.    number.  which means that your example opens screen 1, then, when you
  93.    call Load Iff, closes it and opens it again.
  94.  
  95.  * Are you still using screen 0 (the default screen)?  Otherwise it stays
  96.    open, wasting memory.  Substitute screens 0 and 1 for 1 and 2 and you'll
  97.    save quite a bit of chip RAM.
  98.  
  99. I'd use this:
  100.  
  101. load iff "infest:players",0        replace default screen with
  102.                     your "players" picture
  103.  
  104. load iff "infest:gameboard",1        this puts screen 1 in front
  105. screen display 1,,20,,
  106. double buffer                double buffer screen 1
  107. autoback 0
  108. update off
  109. change mouse 2
  110.  
  111. then go on with your animation etc. using screen 1..
  112.  
  113. > p.s.: Are there any books that actually EXPLAIN what each
  114. >       command REALLY does and how it AFFECTS other commads
  115. >       later on in your code???
  116.  
  117. This is something that annoyed me a bit about AMOS at first, too.  There are
  118. so many commands which affect each other, but no real indication of how they
  119. interact.  I just used trial and error.... lots of trial, and lots of errors!
  120.  
  121. > sincerely,
  122. >     hacker@acs.bu.edu
  123. > p.s.: THANKS in advance everyone!!!
  124.  
  125. Hey, no problem!! :-)
  126.  
  127. RL.
  128.  
  129.  
  130. This has been a dinosaur-free announcement.
  131.  
  132. ==========================  Generating: .signature
  133.    Richard Ling             - colour analysis... complete
  134.  u9147063@cs.uow.edu.au     - clipping... complete
  135. ==========================  - rendering... 37.6%
  136.  
  137.